<?php use Backend\Controller\Plugin\AuthorizationPlugin; ?>


<div id="myTabContent" class="tab-content">
		<!-- Thèmes séjours -->
		<div class="row">
			<div class="col-lg-12">
				<div class="form-group">
					<label for="selectLibelleSejour">Thématiques de s&#233;jour</label>
			    	
						<div class="row thematiques-sejour">
							<div class="checkbox checkbox-primary col-lg-3" ng-repeat="(key, theme) in thematiques">
			                                		
		                		<input id="checkbox{{theme.themeId}}" type="checkbox" ng-value="{{theme.themeId}}" name="thematiquesSelectionnes" ng-checked="selection.indexOf(theme.themeId) > -1" ng-click="toggleSelection(theme.themeId)" />
		                		
		                		<label for="checkbox{{theme.themeId}}">
									{{theme.themeLibelle}}
								</label>

		                	</div>
						</div>

				</div>
			</div>
		</div>


		<!-- HIDDEN CHAMP ID AGENCE OU PAS -->
		<?php if( !AuthorizationPlugin::jeSuisUneAgence($this->layout()->loadIdentity) ) { ?>
			<div class="row">
				<div class="col-lg-4">

					<div class="form-group">
						<label for="inputAgenceName">S&#233;lection d'une agence</label>
					    <select id="inputAgenceName" name="sejourAgenceid" class="form-control" ng-model="sejour.agenceId" ng-options="agence.id as agence.libelle for agence in agences" required ng-class="{ 'input-block' : submitted }">
						    	<option style="display:none" value="">S&#233;lectionner une agence</option>
						</select>

						<p ng-show="formSejour.sejourAgenceid.$invalid && submitted == true" class="help-block">Veuillez sélectionner une agence.</p>
					</div>

				</div>
			</div>
		<?php } ?>

		<div class="row">
			<div class="col-lg-6">
				<div class="form-group">
					<label for="selectLibelleSejour">Libell&#233; du s&#233;jour</label>
				    <input id="selectLibelleSejour" name="sejourTitre" maxlength="150" ng-model="sejour.titre" type="text" placeholder="Entrez le libell&#233; d'un s&#233;jour" class="form-control" required ng-class="{ 'input-block' : submitted }">

				    <p ng-show="formSejour.sejourTitre.$invalid && submitted == true" class="help-block">Le nom du séjour est requis.</p>

				</div>
			</div>
			<div class="col-lg-6">
				<div class="row">
					<div class="col-lg-6">
						<label for="inputAgenceDuree">Dur&#233;e</label>
						<div class="form-group input-group">
							<span class="input-group-addon"><i class="fa fa-clock-o"></i></span>
						    <input id="inputAgenceDuree" ng-model="sejour.duree" type="number" placeholder="Saisissez la dur&#233;e" class="form-control">
						</div>
					</div>
					<div class="col-lg-6">

						<label for="inputAgencePrix">Code voyage</label>
						<div class="input-group">
							<span class="input-group-btn">
								<button ng-click="genererNouveauCode()" class="btn btn-default" type="button">Générer</button>
							</span>
					      
					      	<input id="inputAgencePrix" name="sejourCode" uppercase iscodevalid ng-model="sejour.code" type="text" placeholder="Saisissez ou générer" class="form-control">


					    </div><!-- /input-group -->
				      	
				      	<div class="help-block" ng-show="formSejour.sejourCode.$error.iscodevalid">
							Ce code est déjà utilisé. Veuillez en saisir un nouveau.
						</div>
						
					</div>
					<!-- <div class="col-lg-6">
						<label for="inputAgencePrix">Prix</label>
						<div class="form-group input-group">
							<span class="input-group-addon"><i class="fa fa-eur"></i></span>
						    <input id="inputAgencePrix" ng-model="sejour.prix" type="number" placeholder="Saisissez le prix" class="form-control">
						</div>
					</div> -->
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-lg-6">
				<div class="form-group">
					<label for="inputAgenceResume">R&#233;sum&#233;</label>
				    <textarea id="inputAgenceResume" ng-model="sejour.resume" class="form-control" rows="9" placeholder="R&#233;digez un r&#233;sum&#233;"></textarea>
				</div>
			</div>
			<div class="col-lg-6">
				<div class="form-group">
					<label for="inputSejourDescription">Description</label>
				    <textarea ck-editor id="inputSejourDescription" ng-model="sejour.description" class="form-control" rows="2" placeholder="Description de l'annonce"></textarea>
				</div>
			</div>
		</div>
    
	<hr class="style-1">

		<div id="label-image" class="row">
			<div class="col-lg-12">
				<div><label>Image affichée dans les résultats de recherche</label></div>
			</div>			
		</div>	

		<div class="row">

			<div class="col-lg-3">
				<div class="form-group">
				    <div class="controls">
				        <span class="btn btn-success fileinput-button">
				            <i class="fa  fa-plus-circle"></i>
				            <input type="file" name="file" data-url="uploadImageSejour" upload>
				            <span>Parcourir...</span>
				        </span>
				        <input type="hidden" ng-model="sejour.imageUrl" />
				    </div>

				</div>
			</div>

			<div class="col-lg-6">
				<div class="form-group">

					<div ng-show="!files.length && sejour.imageUrl">
						<sejouraccueil th-id="{{sejour.id}}" th-nom="{{sejour.imageUrl}}" th-libelle="{{sejour.titre}}"/>
					</div>

					<div>
						<span ng-show="files.length && !percentage">{{ files[0].name | truncate:20 }}   <em>({{ files[0].size | sizeConverterFilter:1 }})</em></span>
						<span ng-show="files.length && percentage">En cours de téléchargement</span>

						<div class="progress" ng-show="percentage">
						    <div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" style="width: {{percentage}}%;">
						    	<span>{{percentage}}% Complete</span>
						    </div>
						</div>
						<span ng-show="!files.length && !percentage && !sejour.imageUrl">
							Aucune image
						</span>
					</div>
				</div>
			</div>

			<div class="col-lg-3">
				<div class="form-group">
					<button ng-show="files.length || sejour.imageUrl" ng-click="removeImage()" type="button" class="form-control btn btn-xs btn-default">Supprimer</button>
				</div>
			</div>


		</div>
		
		<hr class="style-1">

		<div class="row">
			<div class="col-lg-6">

				<div class="row">
					<div class="col-lg-6">
						<div class="form-group">
							<label for="sejourActivite">Activit&#233;</label>
						    <select id="sejourActivite" required name="sejourActivite" class="form-control" ng-model="sejour.activiteId" ng-options="activite.idAS as activite.libelleAS for activite in activites" ng-class="{ 'input-block' : submitted }">
							    	<option style="display:none" value="">S&#233;lectionner une activit&#233;</option>
							</select>
							<p ng-show="formSejour.sejourActivite.$invalid && submitted == true" class="help-block">Veuillez sélectionner une activité.</p>
						</div>
					</div>
					<div class="col-lg-6">
						<div class="form-group input-group">
							<label for="sejourTypeParcours">Type de parcours</label>
						    <select id="sejourTypeParcours" class="form-control" ng-model="sejour.typeSejoursId" ng-options="type.idTS as type.libelleTS for type in types">
							    	<option style="display:none" value="">S&#233;lectionner un type de s&#233;jour</option>
							</select>
						</div>
					</div>
				</div>
			</div>

		</div>

		<div  class="row">

			<div class="col-lg-6">
				<div class="row">
					<div class="col-lg-6">
						<div class="form-group input-group">
							<label for="inputSejourPays">Pays</label>

						    <select required name="sejourPays" id="inputSejourPays" class="form-control" ng-model="sejour.paysId" ng-options="choixpays.idPays as choixpays.libellePays for choixpays in pays" ng-class="{ 'input-block' : submitted }" ng-init="sejour.paysId = '7'">
							    	<option style="display:none" value="">S&#233;lectionner un pays</option>
							</select>

							<p ng-show="formSejour.sejourPays.$invalid && submitted == true" class="help-block">Veuillez sélectionner un pays.</p>
						</div>
					</div>
					<div class="col-lg-6">
						<div class="form-group input-group">
							<label for="inputSejourRegion">R&#233;gion</label>
						    <select id="inputSejourRegion" class="form-control" ng-model="sejour.regionId" ng-options="region.idRegions as region.libelleRegions for region in filtered = (regions | regionFilter:sejour.paysId)">
							    	<option style="display:none" value="">S&#233;lectionner une r&#233;gion</option>
							</select>
						</div>
					</div>
				</div>
			</div>

			<div class="col-lg-6">
				<div class="form-group input-group">
					<label >Accompagnement pendant le s&#233;jour</label>
					<div>
						<label class="radio-inline">
		                  <input type="radio" ng-model="sejour.accompagnement" name="optionsRadios" id="optionsRadios1" value="libre" checked>
					    	Libre
		                </label>
		                <label class="radio-inline">
		                  <input type="radio" ng-model="sejour.accompagnement" name="optionsRadios" id="optionsRadios2" value="accompagné">
					    	Accompagn&#233;
		                </label>
					</div>
				</div>
			</div>

		</div>

		<hr class="style-1">

		<div class="row">			
			<div class="col-lg-6">
				<div class="row">
					<div class="col-lg-6">
						<div class="form-group input-group">
							<label for="inputSejourNivTech">Niveau technique</label>
							<p>
								<rating value="sejour.niveauTechnique" max="4" readonly="false" on-leave="overStar = null" state-on="'techniqueOn'" state-off="'techniqueOff'"></rating>
							</p>
						</div>
					</div>
					<div class="col-lg-6">
						<div class="form-group input-group">
							<label for="sejourNivPhy">Niveau physique</label>
							<p>
								<rating value="sejour.niveauPhysique" max="5" readonly="false" on-leave="overStar = null" state-on="'physiqueOn'" state-off="'physiqueOff'"></rating>
							</p>
						</div>
					</div>
				</div>
			</div>
			<div class="col-lg-6">
				<div class="form-group input-group">
					<label for="inputSejourNivConfort">Niveau de confort</label>
					<p>
						<rating value="sejour.niveauConfort" max="3" readonly="false" on-leave="overStar = null" state-on="'confortOn'" state-off="'confortOff'"></rating>
					</p>
				</div>
			</div>
		</div>
    
    <hr class="style-1">

    <div class="row">
		<div class="col-lg-6">
			<div class="form-group">
				<label for="pageReservation">Lien du séjour sur le site de l'agence</label>
			    <input id="pageReservation" name="sejourPageResa" ng-model="sejour.pageReservation" urlvalidator type="text" placeholder="Sélectionnez la page de réservation du séjour" class="form-control">
			</div>

			<div class="help-block" ng-show="formSejour.sejourPageResa.$error.urlvalidator">
				Veuillez saisir une url valide (ex : http://... )
			</div>

		</div>
	</div>

    <hr class="style-1">

		<!-- <div class="row">
			<div class="col-lg-6">
				<div class="form-group">
					<label for="sejourDepartVille">Ville de d&#233;part</label>
				    <input id="sejourDepartVille" ng-model="sejour.departVille" type="text" placeholder="Saisissez la ville de d&#233;part" class="form-control">
				</div>
			</div>
			<div class="col-lg-6">
				<div class="form-group">
					<label for="sejourDepartGPS">Coordonn&#233;es GPS de d&#233;part</label>
				    <input id="sejourDepartGPS" ng-model="sejour.departGPS" type="text" placeholder="Saisissez les coordonn&#233;es GPS de d&#233;part" class="form-control">
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-lg-6">
				<div class="form-group">
					<label for="sejourArriveeVille">Ville d'arriv&#233;e</label>
				    <input id="sejourArriveeVille" ng-model="sejour.arriveeVille" type="text" placeholder="Saisissez la ville d'arriv&#233;e" class="form-control">
				</div>
			</div>
			<div class="col-lg-6">
				<div class="form-group">
					<label for="sejourArriveeGPS">Coordonn&#233;es GPS de d'arriv&#233;e</label>
				    <input id="sejourArriveeGPS" ng-model="sejour.arriveeGPS" type="text" placeholder="Saisissez les coordonn&#233;es GPS de d'arriv&#233;e" class="form-control">
				</div>
			</div>
		</div> -->
		<div class="row">
			<div class="col-lg-6">
				<div class="form-group">
					<label for="inputSejourFicheTechnique">Documentation fiche technique</label>
				    <input id="inputSejourFicheTechnique" name="sejourUrl" urlvalidator ng-model="sejour.ficheTechniqueUrl" type="text" placeholder="Saisir le lien vers la documentation technique" class="form-control">
				</div>

				<div class="help-block" ng-show="formSejour.sejourUrl.$error.urlvalidator">
					Veuillez saisir une url valide (ex : http://... )
				</div>

			</div>
		</div>
    <!-- </div> -->
</div>